<!--
  This file is a part of the open-eBackup project.
  This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
  If a copy of the MPL was not distributed with this file, You can obtain one at
  http://mozilla.org/MPL/2.0/.
  
  Copyright (c) [2024] Huawei Technologies Co.,Ltd.
  
  THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
  EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
  MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
  -->


<!DOCTYPE html
  PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en-us" xml:lang="en-us">
<head>
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
   
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="DC.Type" content="topic">
<meta name="DC.Title" content="Step 1: Enabling the Snapshot Function for the Directory Where the Database Table Resides">
<meta name="product" content="">
<meta name="DC.Relation" scheme="URI" content="en-us_topic_0000002200006437.html">
<meta name="prodname" content="">
<meta name="version" content="">
<meta name="brand" content="">
<meta name="DC.Publisher" content="20250306">
<meta name="prodname" content="csbs">
<meta name="documenttype" content="usermanual">
<meta name="DC.Format" content="XHTML">
<meta name="DC.Identifier" content="EN-US_TOPIC_0000002164765358">
<meta name="DC.Language" content="en-us">
<link rel="stylesheet" type="text/css" href="public_sys-resources/commonltr.css">
<title>Step 1: Enabling the Snapshot Function for the Directory Where the Database Table Resides</title>
</head>
<body style="clear:both; padding-left:10px; padding-top:5px; padding-right:5px; padding-bottom:5px"><a name="EN-US_TOPIC_0000002164765358"></a><a name="EN-US_TOPIC_0000002164765358"></a>

<h1 class="topictitle1">Step 1: Enabling the Snapshot Function for the Directory Where the Database Table Resides</h1>
<div><p>Before performing protection, enable the snapshot function for the directory where the Hive database table to be protected resides.</p>
<div class="section"><h4 class="sectiontitle">Prerequisites</h4><p>Before enabling this function, ensure that nodes in the big data cluster are not in the safe mode. For details about how to query whether a node is in safe mode and how to exit the safe mode, see <a href="en-us_topic_0000002164605662.html">Exiting the Cluster Safe Mode</a>.</p>
</div>
<div class="section"><h4 class="sectiontitle">Procedure</h4><ol><li><span>Use PuTTY to log in to any NameNode in the big data cluster.</span></li><li><span>Log in to the Hive client based on the cluster authentication mode. Assume that MRS is used. For details, see "Using a Hive Client" in <a href="https://support.huawei.com/enterprise/en/cloud-computing/mapreduce-service-pid-22396131" target="_blank" rel="noopener noreferrer">MapReduce Service Product Documentation</a> of the corresponding version.</span></li><li><span>Run the following command to query the parent directory of the database table (replace the database name and table name with the actual ones):</span><p><pre class="screen">SHOW CREATE TABLE <em>Database name</em>.<em>Table name</em>;</pre>
<p>For example, in command output <strong>hdfs://hacluster/user/hive/warehouse/partion_test.db/OrderInfo</strong>, <strong>/user/hive/warehouse/partion_test.db</strong> is the parent directory of the database table.</p>
</p></li><li><span>For MRS, run the following command to exit the Beeline client:</span><p><pre class="screen">!q</pre>
</p></li><li><span>Run the following command to enable the snapshot function for the directory:</span><p><pre class="screen">hdfs dfsadmin -allowSnapshot <em>directory_name</em></pre>
<p>In the command, <em>directory_name</em> indicates the parent directory of the database table to be protected.</p>
</p></li></ol>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="en-us_topic_0000002200006437.html">Backing Up Hive Backup Sets</a></div>
</div>
</div>

<div class="hrcopyright"><hr size="2"></div><div class="hwcopyright">Copyright &copy; Huawei Technologies Co., Ltd.</div></body>
</html>